<template>
    <div v-if="item">
        <!-- 没有子路由 -->
        <el-menu-item v-if="!item.children" :index="item.path">
            <i :class="item.meta.icon"></i>
            <span slot="title">{{item.meta.title}}</span>
        </el-menu-item>
        <!-- 有子路由 -->
        <el-submenu :index="item.path" v-else>
            <template slot="title">
                <i :class="item.meta.icon"></i>
                <span>{{item.meta.title}}</span>
            </template>
            <SildeItem v-for="child in item.children" :item="child" :key="child.path"></SildeItem>
        </el-submenu>
    </div>
</template>

<script>
export default {
    name: "SildeItem",
    props: {
        item: {
            default: null,
            type: Object,
        },
    },
};
</script>

<style>
</style>